.class public Lcom/instagram/android/d/k/v;
.super Ljava/lang/Object;
.source "RequestPerformerUtil.java"


# direct methods
.method public static a(Landroid/content/Context;Lcom/instagram/android/d/k/d;)Lcom/instagram/android/d/k/h;
    .locals 7
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Landroid/content/Context;",
            "Lcom/instagram/android/d/k/d;",
            ")",
            "Lcom/instagram/android/d/k/h",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 23
    invoke-static {}, Lcom/instagram/android/d/d/a;->a()V

    .line 25
    invoke-virtual {p1}, Lcom/instagram/android/d/k/d;->i()Lcom/instagram/android/d/k/g;

    move-result-object v1

    .line 28
    :try_start_0
    invoke-virtual {p1}, Lcom/instagram/android/d/k/d;->k()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 35
    :try_start_1
    invoke-static {}, Lcom/instagram/android/d/a/a;->a()Lcom/instagram/android/d/a/a;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/instagram/android/d/a/a;->a(Lcom/instagram/android/d/c/g;)Lch/boye/httpclientandroidlib/HttpResponse;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    move-result-object v2

    .line 40
    if-nez v2, :cond_0

    .line 41
    sget v0, Lcom/facebook/ba;->network_error:I

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Lcom/instagram/android/d/k/g;->a(Ljava/lang/String;)Lcom/instagram/android/d/k/h;

    move-result-object v0

    .line 63
    :goto_0
    return-object v0

    .line 29
    :catch_0
    move-exception v0

    .line 30
    sget v0, Lcom/facebook/ba;->unknown_error_occured:I

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Lcom/instagram/android/d/k/g;->a(Ljava/lang/String;)Lcom/instagram/android/d/k/h;

    move-result-object v0

    goto :goto_0

    .line 36
    :catch_1
    move-exception v0

    .line 37
    sget v0, Lcom/facebook/ba;->network_error:I

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Lcom/instagram/android/d/k/g;->a(Ljava/lang/String;)Lcom/instagram/android/d/k/h;

    move-result-object v0

    goto :goto_0

    .line 45
    :cond_0
    :try_start_2
    invoke-interface {v1, v2}, Lcom/instagram/android/d/k/g;->a(Lch/boye/httpclientandroidlib/HttpResponse;)Lcom/instagram/android/d/k/h;

    move-result-object v0

    .line 46
    if-nez v0, :cond_1

    .line 47
    sget v0, Lcom/facebook/ba;->unknown_error_occured:I

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Lcom/instagram/android/d/k/g;->a(Ljava/lang/String;)Lcom/instagram/android/d/k/h;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_3

    move-result-object v0

    .line 61
    :cond_1
    :try_start_3
    invoke-interface {v2}, Lch/boye/httpclientandroidlib/HttpResponse;->getEntity()Lch/boye/httpclientandroidlib/HttpEntity;

    move-result-object v1

    invoke-static {v1}, Lch/boye/httpclientandroidlib/util/EntityUtils;->consume(Lch/boye/httpclientandroidlib/HttpEntity;)V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_2

    goto :goto_0

    .line 62
    :catch_2
    move-exception v1

    goto :goto_0

    .line 52
    :catch_3
    move-exception v0

    .line 53
    :try_start_4
    const-string v3, "Could not process response for %s"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v6

    aput-object v6, v4, v5

    invoke-static {v3, v4}, Lcom/instagram/n/i;->a(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3, v0}, Lcom/instagram/g/c;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 58
    sget v0, Lcom/facebook/ba;->unknown_error_occured:I

    invoke-virtual {p0, v0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v0}, Lcom/instagram/android/d/k/g;->a(Ljava/lang/String;)Lcom/instagram/android/d/k/h;
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    move-result-object v0

    .line 61
    :try_start_5
    invoke-interface {v2}, Lch/boye/httpclientandroidlib/HttpResponse;->getEntity()Lch/boye/httpclientandroidlib/HttpEntity;

    move-result-object v1

    invoke-static {v1}, Lch/boye/httpclientandroidlib/util/EntityUtils;->consume(Lch/boye/httpclientandroidlib/HttpEntity;)V
    :try_end_5
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_4

    goto :goto_0

    .line 62
    :catch_4
    move-exception v1

    goto :goto_0

    .line 60
    :catchall_0
    move-exception v0

    .line 61
    :try_start_6
    invoke-interface {v2}, Lch/boye/httpclientandroidlib/HttpResponse;->getEntity()Lch/boye/httpclientandroidlib/HttpEntity;

    move-result-object v1

    invoke-static {v1}, Lch/boye/httpclientandroidlib/util/EntityUtils;->consume(Lch/boye/httpclientandroidlib/HttpEntity;)V
    :try_end_6
    .catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_5

    .line 63
    :goto_1
    throw v0

    .line 62
    :catch_5
    move-exception v1

    goto :goto_1
.end method

.method public static a(Lcom/instagram/android/d/k/d;Lcom/instagram/android/d/k/f;)V
    .locals 5
    .parameter
    .parameter

    .prologue
    .line 69
    instance-of v0, p0, Lcom/instagram/android/d/k/a;

    if-eqz v0, :cond_0

    instance-of v0, p1, Lcom/instagram/android/d/k/l;

    if-nez v0, :cond_0

    .line 70
    new-instance v0, Ljava/lang/RuntimeException;

    const-string v1, "%s is an internal request, but %s does not extend IgRequestCallback"

    const/4 v2, 0x2

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    aput-object v4, v2, v3

    const/4 v3, 0x1

    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-static {v1, v2}, Lcom/instagram/n/i;->a(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 76
    :cond_0
    return-void
.end method
